% Dim Action,username,bbsID,ID,PageInfo CheckString "36" username=MNBoard.MyName Head() Action=request.querystring("Action") Select Case Action Case "Submit" Submit() Case "See" See() Case "Del" Del() Case "TBInfo" TBInfo() Case "Giveback" Giveback() Case "DelAll" DelAll() Case Else Recycle() End Select Footer() Set MNBoard =Nothing Function GetPageInfo(PTable,PFieldslist,PCondiction,POrderlist,PPrimaryKey,PSize,PCookiesName,Purl) Dim P Set P = New Cls_PageView P.strTableName =PTable P.strFieldsList =PFieldslist P.strCondiction =PCondiction P.strOrderList = POrderlist P.strPrimaryKey = PPrimaryKey P.intPageSize = PSize P.intPageNow = Request("page") P.strCookiesName = PCookiesName P.strPageUrl = PUrl P.InitClass GetPageInfo = P.arrRecordInfo PageInfo = P.strPageInfo Set P = nothing End Function Sub Recycle() Response.Write"
" End Sub Sub TBInfo() Response.Write"" End Sub Sub Del() Dim BbsID,TopicID BbsID=Request.querystring("BbsID") TopicID=request.querystring("TopicID") If TopicID=0 then MNBoard.Execute("Delete From [i_Bbs"&MNBoard.TB&"] where IsDel=True And BbsID="&BbsID) MNBoard.Execute("Delete From [i_Appraise] where BbsID="&BbsID&" And TopicID="&TopicID) Suc"","成功删除了这个回复帖!","?" Else MNBoard.Execute("Delete From [i_Topic] where IsDel=True And TopicID="&TopicID) MNBoard.Execute("Delete From [i_TopicVote] where TopicID="&TopicID) MNBoard.Execute("Delete From [i_TopicVoteUser] where TopicID="&TopicID) MNBoard.Execute("Delete From [i_Bbs"&MNBoard.TB&"] where BbsID="&BbsID&" or ReplyTopicID="&TopicID) MNBoard.Execute("Delete From [i_Appraise] where TopicID="&TopicID) Suc"","成功删除这个主题(包括其回复帖)!","?" End if End Sub Sub DelAll() Dim AllTable,I AllTable=Split(MNBoard.BBStable(0),",") Set Rs=MNBoard.Execute("Select TopicID,SqlTableID From [i_Topic] where IsDel=1") Do while Not Rs.eof MNBoard.Execute("Delete * From [i_Bbs"&Rs(1)&"] where ReplyTopicID="&Rs(0)&"") Rs.movenext Loop Rs.Close For i=0 To uBound(AllTable) MNBoard.Execute("Delete * From [i_Bbs"&AllTable(i)&"] where IsDel=1") Next MNBoard.Execute("Delete From [i_Topic] where IsDel=1") MNBoard.execute("delete * from [i_TopicVote] where not exists (select name from [i_Topic] where [i_TopicVote].TopicID=[i_Topic].TopicId)") MNBoard.execute("delete * from [i_TopicVoteUser] where not exists (select name from [i_Topic] where [i_TopicVoteUser].TopicID=[i_Topic].TopicId)") MNBoard.execute("delete * from [i_Appraise] where not exists (select TopicID from [i_Topic] where [i_Appraise].TopicID=[i_Topic].TopicId)") Suc"","成功清空了回收站!","?" End Sub Sub Giveback Dim BbsID,TopicID,ReplyTopicID,BoardID,Temp BbsID=request.querystring("BbsID") Set Rs=MNBoard.Execute("Select TopicID,ReplyTopicID,BoardID,IsDel From[i_Bbs"&MNBoard.TB&"] where BbsID="&BbsID) IF Rs.eof Then GoBack"","该帖不存在或者已经被永久删除":Exit Sub End IF If Rs(0)=0 And Rs(1)<>0 then MNBoard.Execute("Update [i_Config] Set AllEssayNum=AllEssayNum+1") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+1 Where BoardID="&Rs(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set ReplyNum=ReplyNum+1,IsDel=0 where TopicID="&Rs(1)) MNBoard.Execute("Update [i_Bbs"&MNBoard.TB&"] Set IsDel=0 where TopicID="&Rs(1)&" or BbsID="&BbsID) Else Temp=MNBoard.Execute("Select ReplyNum From[i_Topic] where TopicID="&Rs(0))(0) MNBoard.Execute("Update [i_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&Temp+1&"") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+"&Temp+1&",TopicNum=TopicNum+1 Where BoardID="&Rs(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set IsDel=0 where TopicID="&Rs(0)) MNBoard.Execute("update [i_Bbs"&MNBoard.TB&"] Set IsDel=0 where BbsID="&BbsID) End if Rs.Close Suc"","成功的恢复帖子","?" End Sub Sub Submit() Dim Topic,Reply,Go,Temp,i Topic=Request.form("Topic") Reply=Request.form("Reply") IF Topic="" And Reply="" Then GoBack"","请先选择项目。":Exit Sub Topic=split(Topic,",") Reply=split(Reply,",") Go=Request.form("Go") If Go="删除所选" then For i=0 to ubound(Topic) Temp=split(Topic(I),"|") MNBoard.Execute("Delete From [i_Bbs"&Temp(2)&"] where TopicID="&Temp(0)&" or ReplyTopicID="&Temp(0)) MNBoard.Execute("Delete From [i_Topic] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_TopicVote] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_TopicVoteUser] where TopicID="&Temp(0)) MNBoard.Execute("Delete From [i_Appraise] where TopicID="&Temp(0)) Next For i=0 to ubound(Reply) Temp=split(Reply(I),"|") MNBoard.Execute("Delete From [i_Bbs"&Temp(3)&"] where BbsID="&Temp(0)) MNBoard.Execute("Delete From [i_Appraise] where BbsID="&Temp(0)&" And TopicID="&Temp(1)) Next Suc"","成功的删除所选的帖子","?" ElseIF Go="还原所选" then Dim TempNum For i=0 to ubound(Topic) Temp=split(Topic(I),"|") TempNum=MNBoard.Execute("Select ReplyNum From[i_Topic] where TopicID="&Temp(0))(0) MNBoard.Execute("Update [i_Config] Set TopicNum=TopicNum+1,AllEssayNum=AllEssayNum+"&TempNum+1&"") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+"&TempNum+1&",TopicNum=TopicNum+1 Where BoardID="&Temp(1)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set IsDel=0 where TopicID="&Temp(0)) MNBoard.Execute("update [i_Bbs"&Temp(2)&"] Set IsDel=0 where TopicID="&Temp(0)) Next For i=0 to ubound(Reply) Temp=split(Reply(I),"|") Set Rs=MNBoard.Execute("Select Top 1 BbsID From[i_Bbs"&Temp(3)&"] where BbsID="&Temp(0)&" And IsDel=1") If Not Rs.Eof Then MNBoard.Execute("Update [i_Config] Set AllEssayNum=AllEssayNum+1") MNBoard.Execute("Update [i_Board] Set EssayNum=EssayNum+1 Where BoardID="&Temp(2)&" And ParentID<>0") MNBoard.Execute("Update [i_Topic] Set ReplyNum=ReplyNum+1,IsDel=0 where TopicID="&Temp(1)) MNBoard.Execute("Update [i_Bbs"&Temp(3)&"] Set IsDel=0 where TopicID="&Temp(1)&" or BbsID="&Temp(0)) End If Rs.Close Next Suc"","成功的还原所选的帖子","?" End If End SUB Sub See() Dim BbsID,IUBB,EssayType,TopicID,ReplyTopicID,Arr_Rs,i,Sqlwhere BbsID=Trim(Request.querystring("BbsID")) TopicID=Request.querystring("TopicID") ReplyTopicID=Request.querystring("ReplyTopicID") If ReplyTopicID="" Then Sqlwhere="TopicID="&TopicID&" or ReplyTopicID="&TopicID If TopicID="" or TopicID="0" Then Sqlwhere="BBSID="&BBSID Arr_rs=GetPageInfo("[i_Bbs"&MNBoard.TB&"]","BbsID,Caption,Content,Name,LastTime,BoardID,TopicID,ReplyTopicID,UbbString,Face,IP",Sqlwhere,"TopicID desc","BbsID",10,"Recycle"&BBSID,"?action=See&BBSID="&BBSID&"&TopicID="&TopicID&"&ReplyTopicID="&ReplyTopicID) If IsArray(Arr_Rs) Then Response.Write"" Response.Write"" If Arr_Rs(7,i)=0 Then Response.Write ""&MNBoard.Fun.HtmlCode(Arr_Rs(1,i))&"" Response.Write"
"&IUBB.UBB(Arr_Rs(2,i),1)&"